<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%><%@ 
	page import="net.sf.json.*, kr.co.redcircle.service.oAuth.model.SNSModel,kr.co.redcircle.service.oAuth.model.SNSServiceBuilder,kr.co.redcircle.oauth.authorize.SessionManager"
%><%
	
	// setup oauth session manager
	SessionManager manager = null;
	Object sMgr = session.getAttribute("oauth_manager");
	if (sMgr != null){

		manager = (SessionManager)sMgr;
 		String[] parameterArray = new String[2];
 		parameterArray[0] = request.getParameter("note_main");
 		JSONArray jarray = new JSONArray();
 		
 		JSONObject p00 = new JSONObject();
 		p00.put("key", "TITLE");
 		p00.put("value", request.getParameter("note_title"));
 		
 		JSONObject p01 = new JSONObject();
 		p01.put("key", "CONTENTS_BODY");
 		p01.put("value", request.getParameter("note_contents"));
 		
 		JSONObject p02 = new JSONObject();
 		p02.put("key", "COMMENT");
 		p02.put("value", request.getParameter("note_comment"));
 		
 		jarray.add(p00);
 		jarray.add(p01);
 		jarray.add(p02);
 		
 		
 		JSONObject jobj = new JSONObject();
 		jobj.put("tid", "post.thread");
 		jobj.put("map", jarray);
 		parameterArray[1] =  jobj.toString();
 				
 		System.out.println ("mapInfo : " + parameterArray[1]);
		manager.invoke(parameterArray);
	}
%>{
"result" : true,
"header" : "<td><img src='images/snsIcons/btn_rep_sns_facebook_glay.gif'>&nbsp;<image src='images/snsIcons/btn_rep_sns_twitter.gif'>&nbsp;<image src='images/snsIcons/btn_rep_sns_clog_glay.gif'>&nbsp;<image src='images/snsIcons/btn_rep_sns_yozeem_glay.gif'></td><td> | </td><td>2012-01-25 13:39:28</td><td>공감0</td>",
"contents" : "<td colspan='4'><%=request.getParameter("note_main")%></td><td><input type='button' value='댓글쓰기'><input type='button' value='삭제'></td>"
}